package com.xqb.modules.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import com.xqb.common.annotation.Excel;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 题目
 *
 * @author 赵鹏宇
 * @TableName exa_question
 */
@TableName(value = "exa_question")
@Data
public class ExaQuestion implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 题目id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 机构id
     */
    private Long insId;
    /**
     * 题干
     */
    @Excel(name = "题干")
    private String name;
    /**
     * 题目类型，1：单选题，2：多选题，3：判断题，4：简答题
     */
    @Excel(name = "题目类型，1：单选题，2：多选题，3：判断题，4：简答题")
    private Integer type;
    /**
     * 1级课程分类id
     */
    private Long cateId1;
    /**
     * 2级课程分类id
     */
    private Long cateId2;
    /**
     * 3级课程分类id
     */
    private Long cateId3;
    /**
     * 是否公开
     */
    @Excel(name = "是否公开，0：不公开，1：公开")
    private Integer isOpen;
    /**
     * 难易度，1：简单，2：中等，3：困难
     */
    @Excel(name = "难易度，1：简单，2：中等，3：困难")
    private Integer difficulty;
    /**
     * 回答次数
     */
    private Integer answerTimes;
    /**
     * 回答正确次数
     */
    private Integer correctTimes;
    /**
     * 分值
     */
    @Excel(name = "分值")
    private Integer score;
    /**
     * 部门id
     */
    private Long depId;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;
    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ExaQuestion other = (ExaQuestion) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getInsId() == null ? other.getInsId() == null : this.getInsId().equals(other.getInsId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
                && (this.getCateId1() == null ? other.getCateId1() == null : this.getCateId1().equals(other.getCateId1()))
                && (this.getCateId2() == null ? other.getCateId2() == null : this.getCateId2().equals(other.getCateId2()))
                && (this.getCateId3() == null ? other.getCateId3() == null : this.getCateId3().equals(other.getCateId3()))
                && (this.getIsOpen() == null ? other.getIsOpen() == null : this.getIsOpen().equals(other.getIsOpen()))
                && (this.getDifficulty() == null ? other.getDifficulty() == null : this.getDifficulty().equals(other.getDifficulty()))
                && (this.getAnswerTimes() == null ? other.getAnswerTimes() == null : this.getAnswerTimes().equals(other.getAnswerTimes()))
                && (this.getCorrectTimes() == null ? other.getCorrectTimes() == null : this.getCorrectTimes().equals(other.getCorrectTimes()))
                && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
                && (this.getDepId() == null ? other.getDepId() == null : this.getDepId().equals(other.getDepId()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
                && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getInsId() == null) ? 0 : getInsId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCateId1() == null) ? 0 : getCateId1().hashCode());
        result = prime * result + ((getCateId2() == null) ? 0 : getCateId2().hashCode());
        result = prime * result + ((getCateId3() == null) ? 0 : getCateId3().hashCode());
        result = prime * result + ((getIsOpen() == null) ? 0 : getIsOpen().hashCode());
        result = prime * result + ((getDifficulty() == null) ? 0 : getDifficulty().hashCode());
        result = prime * result + ((getAnswerTimes() == null) ? 0 : getAnswerTimes().hashCode());
        result = prime * result + ((getCorrectTimes() == null) ? 0 : getCorrectTimes().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getDepId() == null) ? 0 : getDepId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        return result;
    }

    @Override
    public String toString() {
        String sb = getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", id=" + id +
                ", insId=" + insId +
                ", name=" + name +
                ", type=" + type +
                ", cateId1=" + cateId1 +
                ", cateId2=" + cateId2 +
                ", cateId3=" + cateId3 +
                ", isOpen=" + isOpen +
                ", difficulty=" + difficulty +
                ", answerTimes=" + answerTimes +
                ", correctTimes=" + correctTimes +
                ", score=" + score +
                ", depId=" + depId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", createBy=" + createBy +
                ", updateBy=" + updateBy +
                ", serialVersionUID=" + serialVersionUID +
                "]";
        return sb;
    }
}